

package com.kimo.shop.common.exception;

import com.kimo.shop.common.enums.KimoHttpStatus;
import com.kimo.shop.common.i18n.I18nMessage;
import lombok.Getter;
import org.springframework.http.HttpStatus;

/**
 * @author kimo-taozhouchuan
 */
@Getter
public class KimoShopBindException extends RuntimeException{

	/**
	 *
	 */
	private static final long serialVersionUID = -4137688758944857209L;

	/**
	 * http状态码
	 */
	private Integer httpStatusCode;

	private Object object;

	/**
	 * @param httpStatus http状态码
	 */
	public KimoShopBindException(KimoHttpStatus httpStatus) {
		super(httpStatus.getMsg());
		this.httpStatusCode = httpStatus.value();
	}

	/**
	 * @param httpStatus http状态码
	 */
	public KimoShopBindException(KimoHttpStatus httpStatus, String msg) {
		super(msg);
		this.httpStatusCode = httpStatus.value();
	}


	public KimoShopBindException(String msg) {
//		super(msg);
		super(I18nMessage.getMessage(msg));
		this.httpStatusCode = HttpStatus.BAD_REQUEST.value();
	}

	public KimoShopBindException(String msg, Object object) {
		super(msg);
		this.httpStatusCode = HttpStatus.BAD_REQUEST.value();
		this.object = object;
	}

}
